package com.fr.report.core;

import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.background.Background;
import com.fr.base.file.ConfigManager;
import com.fr.chart.ChartCollection;
import com.fr.data.condition.CommonCondition;
import com.fr.data.condition.FormulaCondition;
import com.fr.data.condition.ListCondition;
import com.fr.report.CellElement;
import com.fr.report.FineBook;
import com.fr.report.Margin;
import com.fr.report.PaperSetting;
import com.fr.report.PaperSize;
import com.fr.report.Report;
import com.fr.report.ReportSettings;
import com.fr.report.ReportWebAttr;
import com.fr.report.ReportWriteAttr;
import com.fr.report.ResultReport;
import com.fr.report.ResultWorkBook;
import com.fr.report.TemplateReport;
import com.fr.report.TemplateWorkBook;
import com.fr.report.WorkBook;
import com.fr.report.WorkSheet;
import com.fr.report.cellElement.CellExpandAttr;
import com.fr.report.cellElement.core.CellElementAttribute;
import com.fr.report.cellElement.core.DSColumn;
import com.fr.report.cellElement.core.SubReport;
import com.fr.report.core.cal.LayerReport;
import com.fr.report.web.EmailManager;
import com.fr.report.web.Printer;
import com.fr.report.web.ToolBarManager;
import com.fr.report.web.WebForm;
import com.fr.report.web.WebPage;
import com.fr.report.web.WebView;
import com.fr.report.web.WebWrite;
import com.fr.report.web.ui.Button;
import com.fr.report.web.ui.CheckBox;
import com.fr.report.web.ui.CheckBoxGroup;
import com.fr.report.web.ui.ComboBox;
import com.fr.report.web.ui.ComboCheckBox;
import com.fr.report.web.ui.CustomToolBarButton;
import com.fr.report.web.ui.DateEditor;
import com.fr.report.web.ui.DateTimeEditor;
import com.fr.report.web.ui.FileEditor;
import com.fr.report.web.ui.Label;
import com.fr.report.web.ui.ListEditor;
import com.fr.report.web.ui.MultiFileEditor;
import com.fr.report.web.ui.NumberEditor;
import com.fr.report.web.ui.Password;
import com.fr.report.web.ui.Radio;
import com.fr.report.web.ui.RadioGroup;
import com.fr.report.web.ui.TextArea;
import com.fr.report.web.ui.TextEditor;
import com.fr.report.web.ui.TreeComboBoxEditor;
import com.fr.report.web.ui.TreeEditor;
import com.fr.report.web.ui.Widget;
import com.fr.report.web.ui.container.Panel;
import com.fr.report.web.ui.impl.AppletPrint;
import com.fr.report.web.ui.impl.Edit;
import com.fr.report.web.ui.impl.Email;
import com.fr.report.web.ui.impl.Excel;
import com.fr.report.web.ui.impl.ExcelL;
import com.fr.report.web.ui.impl.ExcelO;
import com.fr.report.web.ui.impl.ExcelS;
import com.fr.report.web.ui.impl.Export;
import com.fr.report.web.ui.impl.FlashPrint;
import com.fr.report.web.ui.impl.PDF;
import com.fr.report.web.ui.impl.PDFPrint;
import com.fr.report.web.ui.impl.PageSetup;
import com.fr.report.web.ui.impl.Print;
import com.fr.report.web.ui.impl.PrintPreview;
import com.fr.report.web.ui.impl.Scale;
import com.fr.report.web.ui.impl.ServerPrint;
import com.fr.report.web.ui.impl.Word;
import com.fr.report.web.ui.impl.form.FormSubmitButton;
import com.fr.report.web.ui.impl.page.First;
import com.fr.report.web.ui.impl.page.Last;
import com.fr.report.web.ui.impl.page.Next;
import com.fr.report.web.ui.impl.page.PageNavi;
import com.fr.report.web.ui.impl.page.Previous;
import com.fr.report.web.ui.impl.write.AppendColumnRow;
import com.fr.report.web.ui.impl.write.DeleteColumnRow;
import com.fr.report.web.ui.impl.write.ImportExcelData;
import com.fr.report.web.ui.impl.write.ShowCellValue;
import com.fr.report.web.ui.impl.write.Submit;
import com.fr.report.web.ui.impl.write.SubmitForcibly;
import com.fr.report.web.ui.impl.write.Verify;
import com.fr.report.web.ui.layout.AbsoluteLayout;
import com.fr.report.web.ui.layout.BorderLayout;
import com.fr.report.web.ui.layout.FlowLayout;
import com.fr.report.web.ui.layout.GridLayout;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.swing.Icon;

public class ReportUtils
{
  public static Map widgetIconMap = new HashMap();

  public static void initIconMap()
  {
    widgetIconMap.put(FormSubmitButton.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/preview_16.png"));
    widgetIconMap.put(Button.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/button_16.png"));
    widgetIconMap.put(TextEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/text_field_16.png"));
    widgetIconMap.put(DateEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/date_16.png"));
    widgetIconMap.put(DateTimeEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/date_16.png"));
    widgetIconMap.put(TreeEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/tree_16.png"));
    widgetIconMap.put(TreeComboBoxEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/comboboxtree.png"));
    widgetIconMap.put(CheckBoxGroup.class, BaseUtils.readIcon("/com/fr/web/images/checkbox.png"));
    widgetIconMap.put(RadioGroup.class, BaseUtils.readIcon("/com/fr/web/images/radioon.gif"));
    widgetIconMap.put(NumberEditor.class, BaseUtils.readIcon("/com/fr/web/images/number.png"));
    widgetIconMap.put(Label.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/label_16.png"));
    widgetIconMap.put(FileEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/file_up.png"));
    widgetIconMap.put(MultiFileEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/files_up.png"));
    widgetIconMap.put(ComboBox.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/combo_box_16.png"));
    widgetIconMap.put(ComboCheckBox.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/combo_check_16.png"));
    widgetIconMap.put(CheckBox.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/check_box_16.png"));
    widgetIconMap.put(ListEditor.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/list_16.png"));
    widgetIconMap.put(Password.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/password_field_16.png"));
    widgetIconMap.put(TextArea.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/text_area_16.png"));
    widgetIconMap.put(Radio.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/radio_button_16.png"));
    widgetIconMap.put(Submit.class, BaseUtils.readIcon("/com/fr/web/images/preview.png"));
    widgetIconMap.put(FlashPrint.class, BaseUtils.readIcon("/com/fr/web/images/flashPrint.png"));
    widgetIconMap.put(AppletPrint.class, BaseUtils.readIcon("/com/fr/web/images/appletPrint.png"));
    widgetIconMap.put(PDF.class, BaseUtils.readIcon("/com/fr/web/images/pdf.png"));
    widgetIconMap.put(PDFPrint.class, BaseUtils.readIcon("/com/fr/web/images/pdfPrint.png"));
    widgetIconMap.put(ServerPrint.class, BaseUtils.readIcon("/com/fr/web/images/serverPrint.png"));
    widgetIconMap.put(Email.class, BaseUtils.readIcon("/com/fr/web/images/email.png"));
    widgetIconMap.put(Excel.class, BaseUtils.readIcon("/com/fr/web/images/excel.png"));
    widgetIconMap.put(ExcelO.class, BaseUtils.readIcon("/com/fr/web/images/excel.png"));
    widgetIconMap.put(ExcelS.class, BaseUtils.readIcon("/com/fr/web/images/excel.png"));
    widgetIconMap.put(ExcelL.class, BaseUtils.readIcon("/com/fr/web/images/excel.png"));
    widgetIconMap.put(Word.class, BaseUtils.readIcon("/com/fr/web/images/word.png"));
    widgetIconMap.put(PageSetup.class, BaseUtils.readIcon("/com/fr/web/images/pageSetup.png"));
    widgetIconMap.put(Export.class, BaseUtils.readIcon("/com/fr/web/images/export.png"));
    widgetIconMap.put(PageNavi.class, BaseUtils.readIcon("/com/fr/web/images/pageNumber.png"));
    widgetIconMap.put(First.class, BaseUtils.readIcon("/com/fr/web/images/first.png"));
    widgetIconMap.put(Last.class, BaseUtils.readIcon("/com/fr/web/images/last.png"));
    widgetIconMap.put(Previous.class, BaseUtils.readIcon("/com/fr/web/images/previous.png"));
    widgetIconMap.put(Next.class, BaseUtils.readIcon("/com/fr/web/images/next.png"));
    widgetIconMap.put(Scale.class, BaseUtils.readIcon("/com/fr/web/images/scale.png"));
    widgetIconMap.put(Print.class, BaseUtils.readIcon("/com/fr/web/images/print.png"));
    widgetIconMap.put(AppendColumnRow.class, BaseUtils.readIcon("/com/fr/web/images/appendRow.png"));
    widgetIconMap.put(DeleteColumnRow.class, BaseUtils.readIcon("/com/fr/web/images/deleteRow.png"));
    widgetIconMap.put(Verify.class, BaseUtils.readIcon("/com/fr/web/images/verify.gif"));
    widgetIconMap.put(SubmitForcibly.class, BaseUtils.readIcon("/com/fr/web/images/save2.png"));
    widgetIconMap.put(ShowCellValue.class, BaseUtils.readIcon("/com/fr/web/images/showValue.png"));
    widgetIconMap.put(ImportExcelData.class, BaseUtils.readIcon("/com/fr/web/images/excel.png"));
    widgetIconMap.put(PrintPreview.class, BaseUtils.readIcon("/com/fr/web/images/preview.png"));
    widgetIconMap.put(Edit.class, BaseUtils.readIcon("/com/fr/web/images/edit.png"));
    widgetIconMap.put(CustomToolBarButton.class, BaseUtils.readIcon("/com/fr/web/images/custom_widget.png"));
    widgetIconMap.put(BorderLayout.class, BaseUtils.readIcon("/com/fr/web/images/form/layout_border.png"));
    widgetIconMap.put(FlowLayout.class, BaseUtils.readIcon("/com/fr/web/images/form/layout_flow.png"));
    widgetIconMap.put(GridLayout.class, BaseUtils.readIcon("/com/fr/web/images/form/layout_grid.png"));
    widgetIconMap.put(AbsoluteLayout.class, BaseUtils.readIcon("/com/fr/web/images/form/layout_absolute.png"));
    widgetIconMap.put(Panel.class, BaseUtils.readIcon("/com/fr/web/images/form/resources/panel_16.png"));
  }

  public static Icon createWidgetIcon(Widget paramWidget)
  {
    initIconMap();
    Icon localIcon = (Icon)widgetIconMap.get(paramWidget.getClass());
    if (localIcon == null)
      localIcon = BaseUtils.readIcon("com/fr/web/images/custom_widget.png");
    return localIcon;
  }

  public static Rectangle intersection(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8)
  {
    if (paramInt1 < paramInt5)
      paramInt1 = paramInt5;
    if (paramInt3 < paramInt7)
      paramInt3 = paramInt7;
    if (paramInt2 > paramInt6)
      paramInt2 = paramInt6;
    if (paramInt4 > paramInt8)
      paramInt4 = paramInt8;
    paramInt2 -= paramInt1;
    paramInt4 -= paramInt3;
    if (paramInt2 < -2147483648)
      paramInt2 = -2147483648;
    if (paramInt4 < -2147483648)
      paramInt4 = -2147483648;
    return new Rectangle(paramInt1, paramInt3, paramInt2, paramInt4);
  }

  public static ToolBarManager[] getToolBarFromWorkBook(FineBook paramFineBook, int paramInt)
  {
    ToolBarManager[] arrayOfToolBarManager = null;
    if (paramFineBook != null)
    {
      ReportWebAttr localReportWebAttr;
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
        switch (paramInt)
        {
        case 1:
          WebForm localWebForm = localReportWebAttr.getWebForm();
          if (localWebForm == null)
            break label121;
          arrayOfToolBarManager = localWebForm.getToolBarManagers();
          break;
        case 2:
          WebWrite localWebWrite = localReportWebAttr.getWebWrite();
          if (localWebWrite == null)
            break label121;
          arrayOfToolBarManager = localWebWrite.getToolBarManagers();
          break;
        case 3:
          WebView localWebView = localReportWebAttr.getWebView();
          if (localWebView == null)
            break label121;
          arrayOfToolBarManager = localWebView.getToolBarManagers();
          break;
        default:
          WebPage localWebPage = localReportWebAttr.getWebPage();
          if (localWebPage == null)
            break label121;
          arrayOfToolBarManager = localWebPage.getToolBarManagers();
        }
    }
    label121: return arrayOfToolBarManager;
  }

  public static EmailManager getEmailManagerFromWorkBook(FineBook paramFineBook)
  {
    ReportWebAttr localReportWebAttr;
    EmailManager localEmailManager = null;
    if (paramFineBook != null)
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
        localEmailManager = localReportWebAttr.getEmailManager();
    if (localEmailManager == null)
    {
      localReportWebAttr = FRContext.getConfigManager().getReportWebAttr();
      if (localReportWebAttr != null)
        localEmailManager = localReportWebAttr.getEmailManager();
    }
    return localEmailManager;
  }

  public static List getPaperSettingListFromWorkBook(FineBook paramFineBook)
  {
    if (paramFineBook == null)
      return null;
    ArrayList localArrayList = new ArrayList();
    for (int i = 0; i < paramFineBook.getReportCount(); ++i)
    {
      ReportSettings localReportSettings = paramFineBook.getReport(i).getReportSettings();
      if (localReportSettings == null)
        localReportSettings = ReportSettings.DEFAULTSETTINGS;
      localArrayList.add(new PaperSetting(localReportSettings.getPaperSize(), localReportSettings.getMargin(), localReportSettings.getOrientation()));
    }
    return localArrayList;
  }

  public static Background getBrowserBackgroundFromWorkBook(FineBook paramFineBook)
  {
    ReportWebAttr localReportWebAttr;
    Background localBackground = null;
    if (paramFineBook != null)
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
        localBackground = localReportWebAttr.getBackground();
    if (localBackground == null)
    {
      localReportWebAttr = FRContext.getConfigManager().getReportWebAttr();
      if (localReportWebAttr != null)
        localBackground = localReportWebAttr.getBackground();
    }
    return localBackground;
  }

  public static Printer getPrinterFromWorkBook(FineBook paramFineBook)
  {
    ReportWebAttr localReportWebAttr;
    Printer localPrinter = null;
    if (paramFineBook != null)
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
        localPrinter = localReportWebAttr.getPrinter();
    if (localPrinter == null)
    {
      localReportWebAttr = FRContext.getConfigManager().getReportWebAttr();
      if (localReportWebAttr != null)
        localPrinter = localReportWebAttr.getPrinter();
    }
    return localPrinter;
  }

  public static String[] getImportedCssFromWorkBook(FineBook paramFineBook)
  {
    ReportWebAttr localReportWebAttr;
    int i;
    int j;
    HashSet localHashSet = new HashSet();
    if (FRContext.getConfigManager().getReportWebAttr().getCSSImportCount() > 0)
    {
      localReportWebAttr = FRContext.getConfigManager().getReportWebAttr();
      i = 0;
      j = localReportWebAttr.getCSSImportCount();
      while (i < j)
      {
        localHashSet.add(localReportWebAttr.getCSSImport(i));
        ++i;
      }
    }
    if (paramFineBook != null)
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
      {
        i = 0;
        j = localReportWebAttr.getCSSImportCount();
        while (i < j)
        {
          localHashSet.add(localReportWebAttr.getCSSImport(i));
          ++i;
        }
      }
    return ((String[])localHashSet.toArray(new String[localHashSet.size()]));
  }

  public static String[] getWidgetImportedCssFromWorkBook(FineBook paramFineBook)
  {
    ReportWebAttr localReportWebAttr;
    int i;
    int j;
    HashSet localHashSet = new HashSet();
    if (FRContext.getConfigManager().getReportWebAttr().getWidgetCSSImportCount() > 0)
    {
      localReportWebAttr = FRContext.getConfigManager().getReportWebAttr();
      i = 0;
      j = localReportWebAttr.getWidgetCSSImportCount();
      while (i < j)
      {
        localHashSet.add(localReportWebAttr.getWidgetCSSImport(i));
        ++i;
      }
    }
    if (paramFineBook != null)
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
      {
        i = 0;
        j = localReportWebAttr.getWidgetCSSImportCount();
        while (i < j)
        {
          localHashSet.add(localReportWebAttr.getWidgetCSSImport(i));
          ++i;
        }
      }
    return ((String[])localHashSet.toArray(new String[localHashSet.size()]));
  }

  public static String[] getWriteImportedCssFromWorkBook(FineBook paramFineBook)
  {
    ReportWebAttr localReportWebAttr;
    int i;
    int j;
    HashSet localHashSet = new HashSet();
    if (FRContext.getConfigManager().getReportWebAttr().getWriteCSSImportCount() > 0)
    {
      localReportWebAttr = FRContext.getConfigManager().getReportWebAttr();
      i = 0;
      j = localReportWebAttr.getWriteCSSImportCount();
      while (i < j)
      {
        localHashSet.add(localReportWebAttr.getWriteCSSImport(i));
        ++i;
      }
    }
    if (paramFineBook != null)
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
      {
        i = 0;
        j = localReportWebAttr.getWriteCSSImportCount();
        while (i < j)
        {
          localHashSet.add(localReportWebAttr.getWriteCSSImport(i));
          ++i;
        }
      }
    return ((String[])localHashSet.toArray(new String[localHashSet.size()]));
  }

  public static String[] getImportedJsFromWorkBook(FineBook paramFineBook)
  {
    ReportWebAttr localReportWebAttr;
    int i;
    int j;
    HashSet localHashSet = new HashSet();
    if (FRContext.getConfigManager().getReportWebAttr().getJSImportCount() > 0)
    {
      localReportWebAttr = FRContext.getConfigManager().getReportWebAttr();
      i = 0;
      j = localReportWebAttr.getJSImportCount();
      while (i < j)
      {
        localHashSet.add(localReportWebAttr.getJSImport(i));
        ++i;
      }
    }
    if (paramFineBook != null)
      if ((localReportWebAttr = paramFineBook.getReportWebAttr()) != null)
      {
        i = 0;
        j = localReportWebAttr.getJSImportCount();
        while (i < j)
        {
          localHashSet.add(localReportWebAttr.getJSImport(i));
          ++i;
        }
      }
    return ((String[])localHashSet.toArray(new String[localHashSet.size()]));
  }

  public static ReportSettings getReportSettings(Report paramReport)
  {
    ReportSettings localReportSettings = paramReport.getReportSettings();
    if (localReportSettings == null)
    {
      localReportSettings = new ReportSettings();
      paramReport.setReportSettings(localReportSettings);
    }
    return localReportSettings;
  }

  public static boolean hasLayerReport4ExecutedWB(WorkBook paramWorkBook)
  {
    if (paramWorkBook == null)
      return false;
    for (int i = 0; i < paramWorkBook.getReportCount(); ++i)
      for (Object localObject = paramWorkBook.getReport(i); localObject instanceof PackedReport; localObject = ((PackedReport)localObject).getPackee())
        if (localObject instanceof LayerReport)
          return true;
    return false;
  }

  public static boolean hasLayerReport4Template(FineBook paramFineBook)
  {
    if (paramFineBook == null)
      return false;
    for (int i = 0; i < paramFineBook.getReportCount(); ++i)
    {
      Report localReport = paramFineBook.getReport(i);
      if ((localReport instanceof WorkSheet) && (((WorkSheet)localReport).getLayerReportAttr() != null))
        return true;
    }
    return false;
  }

  public static void submit(ResultWorkBook paramResultWorkBook, TemplateWorkBook paramTemplateWorkBook, Map paramMap)
    throws FormException
  {
    if ((paramResultWorkBook == null) || (paramTemplateWorkBook == null))
      return;
    int i = 0;
    int j = paramTemplateWorkBook.getReportCount();
    while (i < j)
    {
      TemplateReport localTemplateReport = paramTemplateWorkBook.getTemplateReport(i);
      ResultReport localResultReport = paramResultWorkBook.getResultReport(i);
      ReportWriteAttr localReportWriteAttr = localTemplateReport.getReportWriteAttr();
      if (localReportWriteAttr != null)
      {
        if (localReportWriteAttr.getSubmiterCount() == 0)
          break label135:
        localReportWriteAttr.submit(localResultReport, paramTemplateWorkBook, paramMap);
        Iterator localIterator = localResultReport.cellIterator();
        while (localIterator.hasNext())
        {
          CellElement localCellElement = (CellElement)localIterator.next();
          localCellElement.removeAttribute(CellElementAttribute.ORIGINAL);
          localCellElement.removeAttribute(CellElementAttribute.INSERT_NEW);
        }
      }
      label135: ++i;
    }
  }

  public static boolean isLayerReportUsable(Report paramReport)
  {
    CellElement localCellElement;
    if (paramReport == null)
      return false;
    if (paramReport.floatIterator().hasNext())
      return false;
    Iterator localIterator = paramReport.cellIterator();
    String str = null;
    do
    {
      if (!(localIterator.hasNext()))
        break label222;
      localCellElement = (CellElement)localIterator.next();
      if (localCellElement.getValue() instanceof ChartCollection)
        return false;
      if (localCellElement.getValue() instanceof SubReport)
        return false;
      if (localCellElement.getValue() instanceof DSColumn)
      {
        DSColumn localDSColumn = (DSColumn)localCellElement.getValue();
        if (str == null)
          str = localDSColumn.getDSName();
        else if (!(str.equals(localDSColumn.getDSName())))
          return false;
        if (localDSColumn.getCondition() != null)
        {
          if ((localDSColumn.getCondition() instanceof ListCondition) && (((ListCondition)localDSColumn.getCondition()).getJoinConditionCount() > 0))
            return false;
          if ((localDSColumn.getCondition() instanceof FormulaCondition) || (localDSColumn.getCondition() instanceof CommonCondition))
            return false;
        }
      }
      if ((localCellElement.getCellExpandAttr() != null) && (localCellElement.getCellExpandAttr().getDirection() == 1))
        return false;
    }
    while (localCellElement.getWidget() == null);
    return false;
    label222: return true;
  }

  public static boolean isWebPageModel(ReportWebAttr paramReportWebAttr)
  {
    if ((paramReportWebAttr != null) && (paramReportWebAttr.getWebPage() != null))
      return paramReportWebAttr.getWebPage().isPageView();
    if ((FRContext.getConfigManager().getReportWebAttr() != null) && (FRContext.getConfigManager().getReportWebAttr().getWebPage() != null))
      return FRContext.getConfigManager().getReportWebAttr().getWebPage().isPageView();
    return true;
  }

  public static boolean isWebPagePaintModel(ReportWebAttr paramReportWebAttr)
  {
    if ((paramReportWebAttr != null) && (paramReportWebAttr.getWebPage() != null))
      return paramReportWebAttr.getWebPage().isShowAsImage();
    if ((FRContext.getConfigManager().getReportWebAttr() != null) && (FRContext.getConfigManager().getReportWebAttr().getWebPage() != null))
      return FRContext.getConfigManager().getReportWebAttr().getWebPage().isShowAsImage();
    return false;
  }

  public static int getPaperWidth(PaperSetting paramPaperSetting)
  {
    PaperSize localPaperSize = paramPaperSetting.getPaperSize();
    if (paramPaperSetting.getOrientation() == 1)
      return (int)(localPaperSize.getHeight() * 96.0D);
    return (int)(localPaperSize.getWidth() * 96.0D);
  }

  public static int getPaperHeight(PaperSetting paramPaperSetting)
  {
    PaperSize localPaperSize = paramPaperSetting.getPaperSize();
    if (paramPaperSetting.getOrientation() == 1)
      return (int)(localPaperSize.getWidth() * 96.0D);
    return (int)(localPaperSize.getHeight() * 96.0D);
  }

  public static int getMarginTop(PaperSetting paramPaperSetting)
  {
    return (int)(paramPaperSetting.getMargin().getTop() * 96.0D);
  }

  public static int getMarginBottom(PaperSetting paramPaperSetting)
  {
    return (int)(paramPaperSetting.getMargin().getBottom() * 96.0D);
  }

  public static int getMarginLeft(PaperSetting paramPaperSetting)
  {
    return (int)(paramPaperSetting.getMargin().getLeft() * 96.0D);
  }

  public static int getMarginRight(PaperSetting paramPaperSetting)
  {
    return (int)(paramPaperSetting.getMargin().getRight() * 96.0D);
  }

  public static int getHeaderHeight(ReportSettings paramReportSettings)
  {
    return (int)(paramReportSettings.getHeaderHeight() * paramReportSettings.getResolution());
  }

  public static int getFooterHeight(ReportSettings paramReportSettings)
  {
    return (int)(paramReportSettings.getFooterHeight() * paramReportSettings.getResolution());
  }
}